package nfa;

import interfaces.Transition;

/**
 *
 * @author Ricardo Sansores
 */
public class AutomataTransition implements Transition{
   
    private AutomataNode outputNode;
    private Character transitionChar;

    public AutomataTransition(AutomataNode outputNode, char transitionChar) {
        this.outputNode = outputNode;
        this.transitionChar = transitionChar;
    }

    /**
     * @return the outputNode
     */
    public AutomataNode getOutputNode() {
        return outputNode;
    }

    /**
     * @param outputNode the outputNode to set
     */
    public void setOutputNode(AutomataNode outputNode) {
        this.outputNode = outputNode;
    }

    /**
     * @return the transitionChar
     */
    public Character getTransitionChar() {
        return transitionChar;
    }

    /**
     * @param transitionChar the transitionChar to set
     */
    public void setTransitionChar(Character transitionChar) {
        this.transitionChar = transitionChar;
    }

    public String getToNodeName() {
        return outputNode.getName();
    }

    public String getTransitionLabel() {
        return this.transitionChar.toString();
    }
    
    public void setToNodeName(String toNodeName) {
        this.outputNode.setName(toNodeName);
    }

    public void setTransitionLabel(String transitionLabel) {
        this.transitionChar = transitionLabel.charAt(0);
    }
    
}
